import request from '@/utils/request'

// 获取用户列表
export function getUserList(params) {
  return request({
    url: '/auth/user/list',
    method: 'get',
    params
  })
};

// 获取用户详情
export function getUser(id) {
  return request({
    url: '/auth/user/get/' + id,
    method: 'get'   
  })
};

// 保存用户
export function saveUser(data) {
  return request({
    url: '/auth/user/save',
    method: 'post',
    data
  })
};

// 物理删除用户
export function deleteUser(id) {
  return request({
    url: '/auth/user/delete/' + id,
    method: 'delete'
  })
};

// 逻辑删除用户
export function deleteByLogic(id) {
  return request({
    url: '/auth/user/deleteByLogic/' + id,
    method: 'delete'
  })
};

// 批量删除用户
export function deleteByIds(ids) {
  return request({
    url: '/auth/user/deleteByIds?ids=' + ids,
    method: 'delete'
  })
};

// 获取未分配角色用户列表
export function getUnAssignmentUserList(roleId) {
  return request({
    url: '/auth/user/getUnAssignmentUserList/' + roleId,
    method: 'get'   
  })
};
